﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Xpom_Xpum__Integrated_Development_Environment.Model.Controls
{
    public class TabItemModel
    {
        #region Constructor

        public TabItemModel()
        {
            TextEditor = new View.Controls.TextEditorView();
        }

        #endregion

        #region Commands

        #endregion

        #region Fields

        #endregion

        #region Properties

        public string Code
        {
            get
            {
                return TextEditor.Text2;
            }
            set
            {
                TextEditor.Text2 = value;
            }
        }

        public string Header { get; set; }

        public string Path { get; set; }

        public View.Controls.TextEditorView TextEditor { get; set; }

        #endregion

        #region Methods

        public void Undo()
        {
            TextEditor.Undo();
        }

        public void Redo()
        {
            TextEditor.Redo();
        }

        public void Cut()
        {
            TextEditor.Cut();
        }

        public void Copy()
        {
            TextEditor.Copy();
        }

        public void Paste()
        {
            TextEditor.Paste();
        }

        public void Delete()
        {
            TextEditor.SelectedText = "";
        }

        public void SelectAll()
        {
            TextEditor.SelectAll();
        }

        public void Focus()
        {
            TextEditor.Focus();
        }

        public void Find(string findWhat, bool findPrevious = false,
            bool matchCase = false, bool matchWholeWord = false, bool useWildcards = false)
        {
            TextEditor.Find(findWhat, findPrevious, matchCase, matchWholeWord, useWildcards);
        }

        #endregion
    }
}
